;       /* Tests the math functions and jumps */

BEG                                     ; Begin program
;
; PROMPT FOR 2 INPUTS, MULTIPLY TOGETHER
PTC     '\n'    ;
PTC     '-'     ;
PTC     'M'     ;
PTC     'U'     ;
PTC     'L'     ;
PTC     'T'     ;
PTC     'I'     ;
PTC     'P'     ;
PTC     'L'     ;
PTC     'Y'     ;
PTC     '-'     ;
PTC     '\n'    ; New line

GET     R0      ; Get initial value
GET     R1      ; Get initial value 2
MUL     R0,R1   ; Multiply them together
PUT     R0      ;
PTC     '\n'    ; New line
CLR     R0
CLR     R1
;

; PROMPT FOR 2 INPUTS, DIVIDE TOGETHER
PTC     '\n'    ;
PTC     '-'     ;
PTC     'D'     ;
PTC     'I'     ;
PTC     'V'     ;
PTC     'I'     ;
PTC     'S'     ;
PTC     'I'     ;
PTC     'O'     ;
PTC     'N'     ;
PTC     '-'     ;
PTC     '\n'    ; New line

GET     R3      ;
GET     R4      ;
DIV     R3,R4   ; Divide them
PUT     R3      ;
PTC     '\n'    ; New line
CLR     R3      ;
CLR     R4      ;
;

; PROMPT FOR 2 INPUTS, ADDITION TOGETHER
PTC     '\n'    ;
PTC     '-'     ;
PTC     'A'     ;
PTC     'D'     ;
PTC     'D'     ;
PTC     'I'     ;
PTC     'T'     ;
PTC     'I'     ;
PTC     'O'     ;
PTC     'N'     ;
PTC     '-'     ;
PTC     '\n'    ; New line

GET     R5      ;
GET     R6      ;
ADD     R5,R6   ; Add them
PUT     R5      ;
PTC     '\n'    ; New line
CLR     R5      ;
CLR     R6      ;
;

; PROMPT FOR 2 INPUTS, SUBTACT TOGETHER
PTC     '\n'    ;
PTC     '-'     ;
PTC     'S'     ;
PTC     'U'     ;
PTC     'B'     ;
PTC     'T'     ;
PTC     'R'     ;
PTC     'A'     ;
PTC     'C'     ;
PTC     'T'     ;
PTC     '-'     ;
PTC     '\n'    ; New line

GET     R7      ;
GET     R0      ;
SUB     R7,R0   ; Subtract them
PUT     R7      ;
PTC     '\n'    ; New line
CLR     R7      ;
CLR     R0      ;
;

PTC     '\n'    ;
PTC     'G'     ;
PTC     'O'     ;
PTC     'O'     ;
PTC     'D'     ;
PTC     'B'     ;
PTC     'Y'     ;
PTC     'E'     ;
PTC     '!'     ;
PTC     '\n'    ;
;
END

